% ConTeXt
%
%\def\pgfsysdriver{pgfsys-pdftex.def}
%\tracingmacros=2 \tracingcommands=2
\usemodule[pgfplots]

\pgfplotsset{compat=1.12, lua debug}

\usetikzlibrary{patterns}
\usepgfplotslibrary[patchplots]

\pgfrealjobname{pgfplotstest}

\def\testfile#1{\chapter{#1}}
\def\testsection#1{\message{STARTING TEST SECTION '#1'}\section{#1}}
\def\testsubsection#1{\message{STARTING TEST SUBSECTION '#1'}\subsection{#1}}
\def\testsubsubsection#1{\message{STARTING TEST SUBSUBSECTION '#1'}\subsubsection{#1}}

\def\smallplotstest{%
\addplot[smooth,blue,mark=*] coordinates {
	(-1,	1)
	(-0.75,	0.5625)
	(-0.5,	0.25)
	(-0.25,	0.0625)
	(0,		0)
	(0.25,	0.0625)
	(0.5,	0.25)
	(0.75,	0.5625)
	(1,		1)
};
}

\def\loglogtestplot{
\addplot plot coordinates {
	(5,	8.311600e-02)
	(17,	2.546856e-02)
	(49,	7.407153e-03)
	(129,	2.101922e-03)
	(321,	5.873530e-04)
	(769,	1.622699e-04)
	(1793,	4.442489e-05)
	(4097,	1.207141e-05)
	(9217,	3.261015e-06)
};
\addlegendentry{$d=2$}

\addplot plot coordinates {
	(7,	8.471784e-02)
	(31,	3.044093e-02)
	(111,	1.022145e-02)
	(351,	3.303463e-03)
	(1023,	1.038865e-03)
	(2815,	3.196465e-04)
	(7423,	9.657898e-05)
	(18943,	2.873391e-05)
	(47103,	8.437499e-06)
};
\addlegendentry{$d=3$}
}%

\def\manylogplotsnolegend{%
	\addplot plot coordinates {
		(5,		8.312e-02)
		(17,	2.547e-02)
		(49,	7.407e-03)
		(129,	2.102e-03)
		(321,	5.874e-04)
		(769,	1.623e-04)
		(1793,	4.442e-05)
		(4097,	1.207e-05)
		(9217,	3.261e-06)
	};

	\addplot plot coordinates {
		(7,		8.472e-02)
		(31,	3.044e-02)
		(111,	1.022e-02)
		(351,	3.303e-03)
		(1023,	1.039e-03)
		(2815,	3.196e-04)
		(7423,	9.658e-05)
		(18943,	2.873e-05)
		(47103,	8.437e-06)
	};

	\addplot plot coordinates {
		(9,	7.881e-02)
		(49,	3.243e-02)
		(209,	1.232e-02)
		(769,	4.454e-03)
		(2561,	1.551e-03)
		(7937,	5.236e-04)
		(23297,	1.723e-04)
		(65537,	5.545e-05)
		(178177,	1.751e-05)
	};

	\addplot plot coordinates {
		(11,	6.887e-02)
		(71,	3.177e-02)
		(351,	1.341e-02)
		(1471,	5.334e-03)
		(5503,	2.027e-03)
		(18943,	7.415e-04)
		(61183,	2.628e-04)
		(187903,	9.063e-05)
		(553983,	3.053e-05)
	};

	\addplot plot coordinates {
		(13,	5.755e-02)
		(97,	2.925e-02)
		(545,	1.351e-02)
		(2561,	5.842e-03)
		(10625,	2.397e-03)
		(40193,	9.414e-04)
		(141569,	3.564e-04)
		(471041,	1.308e-04)
		(1496065,	4.670e-05)
	};
	\legend{$d=2$\\$d=3$\\$d=4$\\$d=5$\\$d=6$\\}
}%

\def\manylogplots{%
	\manylogplotsnolegend
	\legend{$d=2$\\$d=3$\\$d=4$\\$d=5$\\$d=6$\\}
}%

\tikzset{prefix=gnuplot/}

\parindent=0pt
\parskip=5pt

\starttext
\placecontent

WARNING: This file is merely a copy-pasted version of the latex tests. It suffices to check whether the context version compiles and does roughly what is expected. The reference test is, however, only available for latex!

\raggedbottom

\input pgfplotstest.file.tex
\input pgfplotstest.function.tex
\input pgfplotstest.expr.tex
\input pgfplotstest.axispath.tex
\input pgfplotstest.axislines.tex
\input pgfplotstest.axislines.3d.tex
\input pgfplotstest.scaling.tex
\input pgfplotstest.ticks.tex
\input pgfplotstest.enlargelimits.tex
\input pgfplotstest.logplotenv.tex
\input pgfplotstest.3d.tex
\input pgfplotstest.hansmeine_app.tex
\input pgfplotstest.legend.tex
\input pgfplotstest.misc.tex
\input pgfplotstest.align.tex
\input pgfplotstest.gridtick.tex
\input pgfplotstest.styles.tex
\input pgfplotstest.errorbars.tex
\input pgfplotstest.plottypes.tex

\stoptext
